import request from '@/utils/request.js'

export const getSuggestApi = (q) => {
  return request({
    url: '/app/v1_0/suggestion',
    method: 'get',
    params: {
      q
    }
  })
}

export const getSearchApi = (params) => {
  return request({
    method: 'get',
    url: '/app/v1_0/search',
    params
  })
}

// 获取用户的历史记录
export const getSearchHistory = () => {
  return request({
    method: 'get',
    url: '/app/v1_0/search/histories'
  })
}

// 删除历史记录
export const getDeleteHistory = () => {
  return request({
    method: 'delete',
    url: '/app/v1_0/search/histories'
  })
}
